import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_demo4_plugin/flutter_demo4_plugin.dart';
import 'package:flutter_demo4_plugin/flutter_demo4_plugin_platform_interface.dart';
import 'package:flutter_demo4_plugin/flutter_demo4_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterDemo4PluginPlatform 
    with MockPlatformInterfaceMixin
    implements FlutterDemo4PluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterDemo4PluginPlatform initialPlatform = FlutterDemo4PluginPlatform.instance;

  test('$MethodChannelFlutterDemo4Plugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterDemo4Plugin>());
  });

  test('getPlatformVersion', () async {
    FlutterDemo4Plugin flutterDemo4Plugin = FlutterDemo4Plugin();
    MockFlutterDemo4PluginPlatform fakePlatform = MockFlutterDemo4PluginPlatform();
    FlutterDemo4PluginPlatform.instance = fakePlatform;
  
    expect(await flutterDemo4Plugin.getPlatformVersion(), '42');
  });
}
